package com.github.prontera.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.prontera.domain.SystemBean;
import com.github.prontera.persistence.CrudMapper;
import com.github.prontera.persistence.SystemBeanMapper;

/**
 * 唐豆豆系统账户
 */
@Service
public class SystemBeanService extends CrudServiceImpl<SystemBean>{
    
	@Autowired
	private SystemBeanMapper mapper;
	
  	@Autowired
    public SystemBeanService(CrudMapper<SystemBean> mapper) {
        super(mapper);
    }

	public boolean insertBean(Long clientId,Long productId, Integer bean, Integer type) {
		SystemBean systemBean=new SystemBean();
		systemBean.setBean(bean);
		systemBean.setProductId(productId);
		systemBean.setClientId(clientId);
		systemBean.setType(type);
		return insert(systemBean)>0;
	}

	public boolean updateBean(SystemBean systemBean) {
		return mapper.updateBean(systemBean)>0;
	}

}
